﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NetFrameworkExtensions.Enterprise.Security
{
  public static class AuthorizableOperations
  {
    public static IAuthorizableOperation ReadEntity(string entityName)
    {
      return new EntityAuthorizableOperation(entityName, AuthorizableOperationKind.Read);
    }
    public static IAuthorizableOperation UpdateEntity(string entityName)
    {
      return new EntityAuthorizableOperation(entityName, AuthorizableOperationKind.Update);
    }
    public static IAuthorizableOperation CreateEntity(string entityName)
    {
      return new EntityAuthorizableOperation(entityName, AuthorizableOperationKind.Create);
    }
    public static IAuthorizableOperation DeleteEntity(string entityName)
    {
      return new EntityAuthorizableOperation(entityName, AuthorizableOperationKind.Delete);
    }
    public static IAuthorizableOperation ReadFeature(string entityName, string featureName)
    {
      return new FeatureAuthorizableOperation(entityName, featureName, AuthorizableOperationKind.Read);
    }
    public static IAuthorizableOperation UpdateFeature(string entityName, string featureName)
    {
      return new FeatureAuthorizableOperation(entityName, featureName, AuthorizableOperationKind.Update);
    }
    public static IAuthorizableOperation ExecuteCommand(string entityName, string commandName)
    {
      return new CommandAuthorizableOperation(entityName, commandName);
    }
  }
}
